/*
 * upload_process.hpp
 *
 *  Created on: 22 May 2011
 *      Author: cccp
 */

#ifndef UPLOAD_PROCESS_HPP
#define UPLOAD_PROCESS_HPP

#include "headers/ifile_server_comms.hpp"

#include <QThread>

class UploadProcess : public QThread
{
    Q_OBJECT

public:

    UploadProcess(QString apiKey, QString uploadFile, bool lastUpload);
    ~UploadProcess();

    void setFolderKey(QString folderKey);
    void run();


public slots:

    //void quit();
    void setServerID(IfileServerComms::UploadServerResponse);
    void uploadProcessFinished(IfileServerComms::UploadFileResponse);
    void currentProgress(int uploadProgressLevel);
    void uploadError(IfileServerComms::HttpError);

signals:

    void uploadProgress(int progress, qint64 fileSize);
    void uploadFinished();
    void lastUploadFinished();

private:

    QString uploadFile;
    qint64 fileSize;
    QString folderKey;
    QString apiKey;
    IfileServerComms * ifileServerComms;
    int serverId;
    bool finishedUploading;
    bool lastUpload;

};


#endif /* UPLOAD_PROCESS_HPP */
